{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import cv2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[[255,   0,   0],\n",
       "        [255,   0,   0],\n",
       "        [255,   0,   0],\n",
       "        ...,\n",
       "        [  0, 255,   0],\n",
       "        [  0, 255,   0],\n",
       "        [  0, 255,   0]],\n",
       "\n",
       "       [[255,   0,   0],\n",
       "        [255,   0,   0],\n",
       "        [255,   0,   0],\n",
       "        ...,\n",
       "        [  0, 255,   0],\n",
       "        [  0, 255,   0],\n",
       "        [  0, 255,   0]],\n",
       "\n",
       "       [[255,   0,   0],\n",
       "        [255,   0,   0],\n",
       "        [255,   0,   0],\n",
       "        ...,\n",
       "        [  0, 255,   0],\n",
       "        [  0, 255,   0],\n",
       "        [  0, 255,   0]],\n",
       "\n",
       "       ...,\n",
       "\n",
       "       [[  0,   0,   0],\n",
       "        [  0,   0,   0],\n",
       "        [  0,   0,   0],\n",
       "        ...,\n",
       "        [255,   0,   0],\n",
       "        [255,   0,   0],\n",
       "        [255,   0,   0]],\n",
       "\n",
       "       [[  0,   0,   0],\n",
       "        [  0,   0,   0],\n",
       "        [  0,   0,   0],\n",
       "        ...,\n",
       "        [255,   0,   0],\n",
       "        [255,   0,   0],\n",
       "        [255,   0,   0]],\n",
       "\n",
       "       [[  0,   0,   0],\n",
       "        [  0,   0,   0],\n",
       "        [  0,   0,   0],\n",
       "        ...,\n",
       "        [255,   0,   0],\n",
       "        [255,   0,   0],\n",
       "        [255,   0,   0]]], dtype=uint8)"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "img = np.zeros((512,512,3), np.uint8)\n",
    "\n",
    "cv2.line(img,(0,0),(511,511),(255,0,0),5)\n",
    "\n",
    "cv2.rectangle(img,(384,0),(510,128),(0,255,0),3)\n",
    "\n",
    "cv2.circle(img,(447,63), 63, (0,0,255), -1)\n",
    "\n",
    "cv2.ellipse(img,(256,253),(100,50),0,0,270,(20,200,40),-1)\n",
    "\n",
    "pts=np.array([[10,5],[70,30],[100,20],[150,100]], np.int32)\n",
    "\n",
    "pts=pts.reshape((-1,1,2))\n",
    "cv2.polylines(img, [pts], True, (0, 255, 255))\n",
    "\n",
    "font=cv2.FONT_HERSHEY_SIMPLEX\n",
    "cv2.putText(img,'OpenCV',(10,450), font, 4,(255,255,255),2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "winname = 'draw'\n",
    "cv2.namedWindow(winname)\n",
    "cv2.imshow(winname,img)\n",
    "cv2.waitKey(0)\n",
    "cv2.destroyWindow(winname)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
